SegmentTransport

class SegmentTransport(analytics: Analytics) : Transport, MetadataAwareTransport

Delivers events through Segment's analytics-kotlin SDK.

Stamping happens inside Segment's pipeline (a Before plugin), so sequence numbers match the order events are enqueued — including events the Segment SDK generates itself, such as Application Opened. The envelope's event_id replaces Segment's messageId, which makes Segment's message deduplication work on Autograph ids.

event_id/messageId stability across a Segment-level retry follows from when stamping happens: AutographPlugin runs once, synchronously, while the event is still being enqueued — before it is written to Segment's local retry queue. A later retry resends that already-serialized payload; it does not re-enqueue the event or re-run Before plugins, so there is nothing left in the retry path that could reassign messageId. AutographPlugin.execute is additionally idempotent (see its KDoc) as a defensive guarantee for this same property, independent of that architectural argument.

An event's EventMetadata (its kind, an impression's thresholds, its screen view id) is added to the same context.instrumentation block through Segment's per-event enrichment closure, which runs after every Before and Enrichment plugin — so after AutographPlugin has stamped the event.

Constructors

Link copied to clipboard
constructor(analytics: Analytics)

Properties

Link copied to clipboard
open override val stampsInPipeline: Boolean

Functions

Link copied to clipboard
open override fun connect(envelopes: EnvelopeSource)
Link copied to clipboard
open override fun flush()
Link copied to clipboard
open override fun identify(userId: String, traits: Map<String, JsonElement>, envelope: Envelope?)
Link copied to clipboard
open override fun reset()
Link copied to clipboard
open override fun screen(name: String, properties: Map<String, JsonElement>, envelope: Envelope?)
open override fun screen(name: String, properties: Map<String, JsonElement>, envelope: Envelope?, metadata: EventMetadata)
Link copied to clipboard
open override fun track(name: String, properties: Map<String, JsonElement>, envelope: Envelope?)
open override fun track(name: String, properties: Map<String, JsonElement>, envelope: Envelope?, metadata: EventMetadata)